<template>
  <div>
    <Bread v-if="detailObj">
      <BreadItem :to="'/'">首页</BreadItem>
      <BreadItem :to="'/'">{{
        detailObj.categories && detailObj.categories[1].name
      }}</BreadItem>
      <BreadItem :to="'/'">{{
        detailObj.categories && detailObj.categories[0].name
      }}</BreadItem>
      <BreadItem>{{ detailObj && detailObj.name }}</BreadItem>
    </Bread>
  </div>
</template>

<script>
// 引入面包屑组件
import Bread from "../utils/Bread.vue";
import BreadItem from "../utils/BreadItem.vue";
export default {
  props: ["detailObj"],
  components: {
    Bread,
    BreadItem,
  },
};
</script>

<style scoped></style>
